<?php
class ReportAction extends AdminAction{
	public function user(){
		import('ORG.Util.Page');
		$db=D('Member');
		$where['mode']=array('in','0,1');
		$count=$db->where($where)->count();
		$page=new Page($count,C('ADMINPAGE'));
		$sql="select a.*,b.account as shopaccount,b.shopname from ".C('DB_PREFIX')."member a left join ".C('DB_PREFIX')."shop b on a.shopid=b.id where a.mode in(0,1) order by a.login_time desc,a.add_time desc limit ".$page->firstRow.','.$page->listRows." ";
        //$result = $db->limit($page->firstRow.','.$page->listRows)->order('add_time desc') -> select();
		
		$result=$db->query($sql);
		$this->assign('page',$page->show());
        $this->assign('lists',$result);
		$this->display();
	}
	
	public function online(){
		import('ORG.Util.Page');
		$db=D('Member');
		
		$count=$db->where()->count();
		$page=new Page($count,C('ADMINPAGE'));
		$sql="select a.*,b.account as shopaccount,b.shopname from ".C('DB_PREFIX')."member a left join ".C('DB_PREFIX')."shop b on a.shopid=b.id order by a.login_time desc,a.add_time desc limit ".$page->firstRow.','.$page->listRows." ";
        //$result = $db->limit($page->firstRow.','.$page->listRows)->order('add_time desc') -> select();
		$result=$db->query($sql);
		$this->assign('page',$page->show());
        $this->assign('lists',$result);
		$this->display();
	}
}